package com.xiangsai;

import com.xiangsai.services.MyServlet;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;


public class JettyTest {
    public static void main(String[] args) throws Exception {
        Server server=new Server(8081);
        ContextHandlerCollection contexts=new ContextHandlerCollection ();
        MyServlet myServlet=new MyServlet();
        ServletContextHandler main=new ServletContextHandler(server,"/",true,false);
        main.addServlet(new ServletHolder(myServlet),"/hello");
        //WebAppContext webAppContext=new WebAppContext("test.war","/test");
        server.start();
        server.join();
    }
}
